home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / net / bind-contrib.tar.gz / bind-contrib.tar / contrib / misc / dns-setup.doc < prev    next >
Encoding:
Internet Message Format  |  1996-10-25  |  31.3 KB

  1. Path: vixie!decwrl!spool.mu.edu!howland.reston.ans.net!xlink.net!fauern!rrze.uni-erlangen.de!not-for-mail
  2. From: fhn019@cd4680fs.rrze.uni-erlangen.de (Franziska Staedtler)
  3. Newsgroups: comp.protocols.tcp-ip.domains
  4. Subject: Setup a nameserver -- corrected version (long)
  5. Date: Tue, 19 Oct 1993 14:41:03 +0100
  6. Organization: Regionales Rechenzentrum Erlangen, Germany
  7. Distribution: inet
  8. Message-ID: <2a0qpfEfj2@uni-erlangen.de>
  9. NNTP-Posting-Host: cd4680fs.rrze.uni-erlangen.de
  10. Lines: 757
  11. Summary: How to setup a nameserver
  12.  
  13.  
  14. Hello netters,
  15.  
  16. this is the second (corrected) version of my little description to 
  17. setup a nameserver. Thanks to Ruediger Volk for his comments 
  18. which pointed out some errors to me. The alterations to the 
  19. first version are marked with ! marks at the beginning of the 
  20. lines.
  21.  
  22. For a more detailed review on the subject I should recommend the really
  23. excellent book
  24.        DNS and BIND
  25. by
  26.    P. Albitz and C.Liu (O'Reilly & Associates, Inc)
  27.  
  28. Thank you, Paul and Cricket, for that book. It helped me no end.
  29.  
  30. Well, since I don't want to spread all the details of our local setup
  31. all over the world (i.e. hostnames and addresses) I wiped these 
  32. details out by using
  33.  
  34. a.b.c.d  to refer to an ip address in dotted notation
  35. host.dep.secdom.topdom  to refer to a full domainname of a host
  36.      ("dep" is standing for one or more subdomain labels in the 
  37.       secondlevel domain "secdom" which in turn is part of the 
  38.       toplevel domain "topdom")
  39.  
  40. Any comments and suggestions are welcome.
  41. Please use my email address fhn019@cd4680fs.rrze.uni-erlangen.de
  42. to contact me.
  43.  
  44. Regards,
  45. Franziska
  46.  
  47. -----------------------------------------------------------------------
  48.  Setting up a primary master nameserver for a non-internet host 
  49.  ============================================================== 
  50.  
  51. General comments:
  52. =================
  53. We use EP/IX for the examples. EP/IX is the system used by the CD4000
  54. systems of Control Data Systems, Inc.
  55.  
  56. For all the files we have to setup for named to work, except
  57. /etc/init.d/netdaemons, the ";" indicates the beginning of a *comment*.
  58.         
  59. All the datafiles of named contain entries that are called
  60.        resource records (RR)
  61. The RRs follow the general syntax
  62.  domainname  ttl  class   type  record-data
  63. where
  64. domainname   gives the object the record is for; if domainname is blank
  65.              named assumes that the record is for the object of the 
  66.              record before this record.
  67. ttl          gives the maximum time the record data is considered valid;
  68.              if ttl is blank than "minimum ttl" in the SOA-Record is used.
  69. class        gives the class to which the record belongs. Valid classes
  70.              are IN (internet) and ANY (any class)
  71. type         gives the type of the record. There a many record types
  72.              but we will use only
  73.              SOA --> Start Of Authority
  74.              NS  --> Name Server
  75.              A   --> Address
  76.              PTR --> PoinTeR
  77.              MX  --> Mail eXchanger
  78.              HINFO --> Host INFO
  79.              The records of these types are described when first used.
  80. data         gives the data belonging to this record. If "data" contains
  81.              parentheses (), the record can span multiple lines.
  82.  
  83. There are two directives that can be used in datafiles:
  84.  
  85. $ORIGIN domain.
  86.     Indicates the origin for the domainnames in the following RRs.
  87.     "domain." is appended to the domainnames given in the RRs.
  88.     I.e  $ORIGIN secdom.topdom.
  89.          ==> "secdom.topdom." is appended to the domainnames of the 
  90.              following RRs in the datafile.
  91.              If there is a RR like this
  92.              host IN A address-of-host
  93.              than named reads "host" as "host.secdom.topdom.".
  94.  
  95. $INCLUDE filename
  96.     Tells named to include the RRs in the specified file here.
  97.     
  98.  
  99. What we need:
  100. =============
  101.  * BIND running on our unix box (/etc/named)
  102.  * bootfile for named (/etc/named.boot)
  103.  * internal root nameserver data file (root.cache)
  104.  * data file for the mapping of 127.0.0.1 to the name "localhost"
  105.    (named.local)
  106.  * data file for the hosts in the domain (named.hosts)
  107.  * data file for the mapping if the ip addresses to the hostnames
  108.    for the local domain (named.rev)
  109.  * directory to put the data files in 
  110.  
  111.  
  112. What we do:
  113. ===========
  114.  
  115. 1. First we look for a file /etc/named which indicates the presence
  116.    of BIND (= Berkeley Internet Domain Name Service). If /etc/named
  117.    exists we check the system startup files (i.e. in /etc/init.d)
  118.    whether named is started when the system goes multiuser.
  119.    The script /etc/init.d/netdaemons is shipped with EP/IX and
  120.    starts named if the bootfile is present.
  121.  
  122.    Example:
  123.    In /etc/init.d/netdaemons we can find the lines
  124.  
  125.    if [ -x /etc/named -a -r /etc/named.boot ]; then
  126.     /etc/named /etc/named.boot;        echo " named\c"
  127.    fi
  128.    
  129.    which start named if /etc/named.boot exists.
  130.  
  131.  
  132. 2. For named to start we have to generate a file /etc/named.boot. This
  133.    is an ASCII file we can edit with our favorite editor.
  134.  
  135.    /etc/named.boot may look like the following:
  136.  
  137.  
  138. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  139. ;   Nameserver bootfile for secdom.topdom       
  140. ;   last change 93/01/27
  141. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  142. ;
  143. ;  @(#)named.boot.master 1.11 of 93/01/25             
  144. ;
  145. ; bootfile for master server fh-nuernberg
  146. ;
  147. directory /confdir  
  148. ;
  149. ; type        domain           source host/file      backup file
  150. ;
  151. primary       secdom.topdom  named.hosts 
  152. primary       b.a.IN-ADDR.ARPA  named.rev
  153. primary       0.0.127.IN-ADDR.ARPA  named.local
  154. primary       .                root.cache
  155.  
  156. ! In the above file I deleted the line with the domain statement.
  157.  
  158.    Let's have a look on this file. The lines start at column one. The line
  159.        directory /confdir  
  160.    tells named where to look for the data files. The line
  161.        primary       secdom.topdom  named.hosts 
  162.    tells named that it is a *primary master* for the domain "secdom.topdom"
  163.    and the data for this domain is in "named.hosts". The next line
  164.        primary       b.a.IN-ADDR.ARPA  named.rev
  165.    tells named that it is a *primary master* for the domain 
  166.    "b.a.IN-ADDR.ARPA" which is used to map the addresses to the names
  167.    and the data for this domain is in "named.rev". The line
  168.        primary       0.0.127.IN-ADDR.ARPA  named.local
  169.    tells named that it is a *primary master* for the domain 
  170.    "0.0.127.IN-ADDR.ARPA" which is used to map the address127.0.0.1
  171.     to the name localhost and the data for this is in "named.local".
  172.     The last line
  173.        primary       .                root.cache
  174.     tells named that it is a *root nameserver* (= primary master for 
  175.     the root domain) and the data is in "root.cache".
  176.  
  177.     The general syntax of the "domain" lines is 
  178.        type   domain   source   backup
  179.     where
  180.     type   determines which *type* of service named should provide for
  181.            the specified domain. *type* may be
  182.            primary     primary master server; holds the zone data on disk
  183.                        This server is authoritative for the specified domain.
  184.            secondary   secondary master server; gets the zone data off a
  185.                        primary server and stores it for a specified time
  186.                        (see also "SOA Resource Record" later)
  187.            cache       caching server; holds no zone data on disk,caches
  188.                        only addresses and hints (i.e. root servers) it
  189.                        learnt by queries.
  190.            ("zone" data means data of the domain the nameserver serves;
  191.            "zones" are parts of the overall address space of the Internet
  192.            for which  authoritative servers (= servers that hold
  193.            the data for this part of the address space) exist.)
  194.  
  195.    domain  gives the domain named serves; 
  196.                 secdom.topdom --> subdomain of the toplevel domain "de"
  197.                                     (see also "the internet address space")
  198.                                 --> *map names to addresses*
  199.                 a.b.IN-ADDR.ARPA --> special domain to map *addresses to 
  200.                                      names*
  201.  
  202.    source  gives the filename or the hostaddress that holds the zone data 
  203.            
  204.    backup  gives the name of a backup file (only used for secondary servers)
  205.  
  206.    The filenames (named.hosts, etc) used above are the names of the 
  207.    example files shipped with BIND. We can change these names if we like.
  208.  
  209.    The named bootfile (standard: /etc/named.boot) may be changed too
  210.    but then we have to change the section in /etc/init.d/netdaemons
  211.    where named is started too.
  212.  
  213.  
  214. 3. Since our host is a non-internet host (= has no connnection to the 
  215.    Internet) we have to setup a *root nameserver* for named to work
  216.    correctly.
  217.  
  218.    In the above bootfile we told named to be a primary server for 
  219.    the root domain (indicated be a period (.) in the domain field)
  220.    and look for the domain data in a file named root.cache in the 
  221.    data file directory /confdir.
  222.  
  223.    This file looks like the following
  224.  
  225.  
  226. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  227. ; temporary root name server is host.dep.secdom.topdom.
  228. ; only to verify our mail configuration and until
  229. ; we are directly connected to the internet
  230. ; FS 08/12/93
  231. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  232. ;
  233. ;      
  234. .   IN  SOA  host.dep.secdom.topdom.  dnsadm.host.dep.secdom.topdom. (
  235.              930813001 ; Serial
  236.              28800     ; Refresh
  237.              7200      ; Retry 
  238.              6044800   ; Expire
  239.              172800 )  ; Minimum
  240.      IN  NS host.dep.secdom.topdom.
  241. ;
  242. ; make hase root name server
  243. ;
  244. secdom.topdom. 172800 IN NS host.dep.secdom.topdom.
  245. b.a.IN-ADDR.ARPA. 172800 IN NS host.dep.secdom.topdom.
  246. ;
  247. ; address records for hase
  248. ;
  249. host.dep.secdom.topdom. 172800 IN A a.b.c.d
  250. ;
  251. ; adding mx records for sendmail to function properly
  252. ;
  253. *          IN  MX  5 host.dep.secdom.topdom.
  254. *.topdom.  IN  MX 10 host.dep.secdom.topdom.
  255.  
  256.  
  257.    This file has four types of RRs in it. Let's have a look on them.
  258.  
  259.    The first RR defines the Start-Of-Authority for the root domain (.).
  260.    The SOA RR has the following general syntax:
  261.  
  262.    domain IN SOA sdom mbox (Serial Refresh 
  263.                             Retry Expire Minimum)
  264.  
  265.    with
  266.    domain   is the name of the domain the SOA record is for
  267.    IN SOA   defines the record as a SOA record of class IN
  268.    sdom     full domainname of the host that holds the zone data
  269.    mbox     mailbox of the person responsible for the nameserver
  270.             (The @ in the common syntax user@domain is replaced
  271.             by a period here since @ has a special meaning to the 
  272.             RRs.) The "mbox" field is not use by the nameserver itself.
  273.             It is reserved for humans to use.
  274.    Serial   Serial number of the datafile. This field should be updated
  275.             whenever the datafile is changed. "Serial" is used to tell
  276.             the secondary nameservers that zone data has changed and 
  277.             should be transfered off the primary inspite of the 
  278.             "Refresh" time not having expired.
  279.    Refresh  Tells the secondaries how often (in seconds) to check for
  280.             the accuracy of their zone data if not notified of changes 
  281.             before.
  282.    Retry    Tells the secondaries what time to wait for getting the 
  283.             zone data off the primary after "Refresh" has expired and 
  284.             they couldn't contact the primary than.
  285.    Expire   Tells the secondaries time after which they should consider
  286.             their zone data invalid when "Refresh" has expired and
  287.             they were unable to contact the primary. After "Expire"
  288.             has expired the secondaries will stop to answers queries
  289.             concerning the zone. 
  290.    Minimum  Time-to-live value for all RRs in the datafile that have
  291.             a blank "ttl" field. This TTL is supplied with answers to 
  292.             queries to tell other nameservers how long the data can be
  293.             considered valid (if they want to cache it)
  294.  
  295.    All time values are given in seconds. 
  296.  
  297.    Now let's have a look at our SOA record for the root domain.
  298.    The sole period in the "domain" field tells that this is the SOA for the 
  299.    root domain. "host.dep.secdom.topdom." in the "sdom" field says that
  300.    this host holds the domain data. All the zone data we need for root
  301.    is included in this file (root.cache) for our purpose. The next
  302.    field indicates that mail concerning the nameserver should be send to
  303.    dnsadm@host.dep.secdom.topdom. The "Serial" consists of the date
  304.    (YYMMDD) of the last change and a three digit sequence number.
  305.    The "Refresh" period is about 8 hours, the "Retry" is 2 hours and
  306.    the secondaries should expire their data after about 16790 hours.
  307.    The default TTL for all the RRs in this file is about 2 days.
  308.  
  309.    
  310.    The next record is a *nameserver* record. This record (NS) defines a
  311.    nameserver for a given domain. The record has the following syntax:
  312.  
  313.    domain  ttl IN NS domainname-of-the-nameserver-host
  314.  
  315.    with
  316.    domain   name of the domain the nameserver is for
  317.    ttl      optional ttl field. If blank the "Minimum" in the SOA record
  318.             is used.
  319.    IN NS    defines the record to be a "nameserver" record of class IN
  320.    domainname-of-the-nameserver-host 
  321.             the full domainname (starting with the hostname and ending
  322.             with a period) of the host that is running the nameserver.
  323.  
  324.  
  325.    In our example there are three NS records.
  326.    The first defines host.dep.secdom.topdom. to be the primary nameserver
  327.    for the root domain. The second makes the same host a primary for
  328.    the local domain (secdom.topdom) and third record makes it a primary
  329.    for the corresponding IN-ADDR.ARPA.-domain. These two records are used
  330.    for delegation of the two domains. Normally those records would have to 
  331.    be in the zone data of the "topdom"- and the "IN-ADDR.ARPA"- servers.
  332.    Since there are no such servers in our net we delegate directly
  333.    in root.cache.
  334.  
  335.    For named to find the nameserver host it has to have an "address"
  336.    record which has the general syntax:
  337.    
  338.    domainname. ttl IN A ip-address-of-domainname
  339.  
  340.    with
  341.    domainname.  is the full domainname of the object the record is for.
  342.                 I use the term "object" instead of "host" here since
  343.                 "domainname." need not be a host. It is recommended to use
  344.                 full domainnames whenever possible since certain 
  345.                 applications (i.e. sendmail) could otherwise run into problems.
  346.    ttl      optional ttl field. If blank the "Minimum" in the SOA record
  347.             is used.
  348.    IN A     says that this is an address record for the class IN
  349.    ip-address-of-domainname
  350.             gives the ip address to be associated with the given 
  351.             domainname in dotted notation (a.b.c.d)
  352.  
  353.    In our example file host.dep.secdom.topdom. is associated with the
  354.    ip address a.b.c.d.
  355.  
  356.    For sendmail we need MX records telling it where to deliver mail that
  357.    is addressed to users in the root domain and in die topdom-domain (= our
  358.    toplevel domain). The MX record has the general appearence:
  359.    
  360.    domain. ttl IN MX preference mailhost
  361.  
  362.    with
  363.    domain.  is the domainname of the object the MX record is for.
  364.    ttl      optional ttl field. If blank the "Minimum" in the SOA record
  365.             is used.
  366.    IN MX    define the record as "mailexchanger" record of class IN.
  367.    preference  tells at which preference the record should be used. There
  368.                can be more than one MX RR of "domain.". Then "preference"
  369.                tells which record to prefere. "preference" is an integer 
  370.                between 0 and 65535. The record with the *lowest* preference
  371.                value (numerical) is considered the *best*.
  372.    mailhost    full domainname of the host the mail for "domain." should
  373.                be send to.
  374.  
  375.  
  376.    In our example mail addressed to the root- and the topdom-domain is sent
  377.    to host.dep.secdom.topdom. Since there is only one MX RR for each
  378.    domain the preference value doesn't matter here.
  379.  
  380.    Now we have setup our internal root nameserver. We are now ready to 
  381.    setup the nameserver for our domain. Before doing this we shall 
  382.    have a look at "The internet name space" and "What a nameserver does".
  383.  
  384.  
  385. The internet name space
  386. =======================
  387.  
  388. Unlike the ip address space which is flat the "internet name space" has a
  389. hierarchical organization. It looks like a tree helt upside down. 
  390. It starts with a root indicated by a period (.). Then there are 
  391. several levels of domains in this tree. The level immediately following
  392. the root is named
  393.     toplevel domains
  394. and used to group universities, companies, ... into larger organizations
  395. or countries. The toplevel domains are either named according to the 
  396. business of the institutions that  belong to them or according to the 
  397. ISO country codes. So names are COM, EDU, NET, MIL, DE, UK, US, etc.
  398.  
  399. The toplevel domains include so called second-level domains which 
  400. represent institutions like universities and companies (i.e. "fh-nuernberg").
  401. In the second-level domains there can be one or more levels of subdomains.
  402. It is not recommended to created too much levels of subdomains since
  403. the internet domain names are used for email addressing and it is 
  404. somewhat trying to have all those subdomains in the email address.
  405.  
  406. An internet domain name consists of several "labels" that are 
  407. separated by periods (.). The "labels" are the names of the domains
  408. in the tree: 
  409.  
  410.    host.subdX.,,,.subd2.subd1.second-level-domain.toplevel-domain  
  411.  
  412. where subdN is part of subd(N-1) for N between 1 and X.
  413.  
  414. ! The labels are given (from left to right) in the order local -->
  415. ! remote with the *farest* (root) at the end (right) of the name.
  416. ! In the zone data files of the nameserver where we have a mechanism
  417. ! to state a default domain (given in /etc/named.boot or with the 
  418. ! $ORIGIN directive in the zone data files) we can use a period (.)
  419. ! at the *end* of a domain name to mark it fully qualified. When we
  420. ! put the period at the end of a domain name in a zone file we tell
  421. ! the nameserver *not* to append the default domain to this name.
  422.  
  423. ! The first label of a domain name may be a hostname (host) or 
  424. ! a subdomain name (subdX). I don't want to tell here that a 
  425. ! domain name *must* begin with a hostname but it *can* begin with 
  426. ! a hostname.
  427.  
  428. What a nameserver does
  429. ======================
  430.  
  431. An internet name server maps 
  432.    names to addresses
  433. The internet (ip) addresses are given in numbers of the form a.b.c.d
  434. which for a human are difficult to remember. So the internet namespace
  435. was created to provide *names* that can be used instead of numbers.
  436. These names have to be mapped to the numbers which the computers can use 
  437. better. 
  438.  
  439. For a unix system there are two means to do this mapping:
  440. * /etc/hosts
  441. * DNS (domain name service), i.e. named
  442.  
  443. For an institution with many hosts (each must have an ip address for 
  444. communication with the other hosts) the /etc/hosts file will grow
  445. very large and due to frequent changes will get quite unmaintainable.
  446. So they have to use a *nameserver* to manage the mapping for their 
  447. institution. 
  448.  
  449. Well, the mapping of names to addresses is only one half. What about
  450. mapping addresses to names? To do this a special domain was created
  451.      IN-ADDR.ARPA.
  452.  
  453. It would be quite unmanageable to maintain all those mappings around 
  454. the world in only one nameserver. Therefore the namespace is split 
  455. into parts that are called *zones*. For each zone there is an
  456. institution that is given the authority to maintain the data for this
  457. zone. This is called *delegation*. The institution which is
  458. authoritative for a zone runs the primary master nameserver for this
  459. zone. I.e. The zone data for fh-nuernberg (zone!) is maintain in 
  460. the computer center of this institution.
  461.  
  462.   Setting up a primary nameserver for a local domain
  463.   ==================================================
  464.  
  465. In "Setting up a primary master nameserver for a non-internet host"
  466. we made a file /etc/named.boot which told named to be a primary for
  467. * the root domain (--> 3.)
  468. * the local domain (--> 4.)
  469. * the reverse-mapping-domains for the local domain and "localhost" (--> 5.)
  470.  
  471. In 3. we made a datafile for the root domain. Now we have to build the
  472. datafile for our local domain. We will name this file 
  473.        named.hosts
  474. in /confdir. That file (as all the others mentioned here too)
  475. is owned be the root account.
  476.  
  477. 4. named.hosts has the following RR types in it:
  478.    SOA, A, MX, HINFO and CNAME.
  479.    Only for the last two types I didn't give a description yet.
  480.    
  481.    domain.  IN HINFO CPU OS
  482.   
  483.    with
  484.    domain. is the domainname the record is for.
  485.    IN HINFO  This is a "host info" record of class IN.
  486.    CPU       gives the type of host, i.e. PC-486.
  487.    OS        gives the operating system the host is running, i.e. MS-DOS.
  488.  
  489.  
  490.    domain. IN CNAME aliased-name.
  491.  
  492.    with
  493.    domain. is the domainname the record is for.
  494.    IN CNAME  This is an "alias" record of class IN.
  495.    aliased-name. gives the name that should be used instead of "domain."
  496.                  when searching for records associated with the object.
  497.  
  498.    Note: There *must not* be other records containing "domain." in their
  499.          domain field if there is a CNAME record for it.
  500.  
  501.    We can use CNAME RRs for hosts that should have more than one hostname.
  502.    Again it is recommended to use full domainnames.
  503.  
  504.    Caution!!!!  We *must not* use CNAME records to define an alias
  505.                 for a whole domain or subdomain!!! CNAME records *may only*
  506.                 be used to define aliases for hosts (leaf objects in the 
  507.                 namespace tree). 
  508.  
  509.    Now what RRs does or datafile contain? First it *must* contain one
  510.    (and only one) SOA record for our domain. This record looks similar
  511.    to that described in 3. for the root domain. The domain field now
  512.    contains a @ or the full name of our domain (secdom.topdom).
  513.    Note: @ in the domain field tells named to use the "current origin"
  514.          here. Be sure that it is setup correct otherwise better take the
  515.          full domainname to avoid any complications.
  516.    Following this record a NS record with blank domain field makes
  517.    host.dep.secdom.topdom. the primary nameserver for our domain.
  518.  
  519.    For each host in our domain the datafile has to contain the following
  520.    records:
  521.    * an A record that gives the corresponding ip address
  522.    * a HINFO record that gives the machine type and the operating system
  523.    * a MX record that tells sendmail where to send mail for this host to.
  524.  
  525.    Since we want to use mail servers in our departments 
  526.    instaed of one big mail server in the computer center we must
  527.    include MX records pointing to those mail servers. Further in order
  528.    to allow mail addressed to 
  529.         user@department.secdom.topdom 
  530.    to be delivered we setup MX records for our subdomains (departments)
  531.    pointing to the correct server.
  532.  
  533.    There are a few users in various departments that will get their mail
  534.    delivered at the central server hosta in rz.secdom.topdom.
  535.    Since we don't want to include their hosts (i.e. PCs) to the subdomain
  536.    rz.secdom.topdom. we shall make them use
  537.         user@secdom.topdom 
  538.    to be their mail address and put a MX record in our datafile that
  539.    directs mail addressed to user@secdom.topdom to hosta.rz.secdom.topdom.
  540.    
  541.    Note: These users *must* have an account on hosta to get their mail
  542.          delivered otherwise it is send back to the sender with a 
  543.          message "user unknown".
  544.  
  545.  
  546. 5. Mapping addresses to names:
  547.  
  548.    Now we have almost finished our setup. There is only one thing left: 
  549.    the mapping of addresses to names. This is done in 
  550.          named.rev
  551.    in /confdir and in 
  552.          named.local
  553.    in the same directory.
  554.  
  555.    For this mapping a special domain has been created: IN-ADDR.ARPA.
  556.    We have to setup datafiles for the subdomains
  557.         b.a 
  558.    and
  559.         0.0.127
  560.    of this domain.
  561.  
  562.    Note that we use the dotted notation (a.b.c.d) in reverse order here!
  563.    If a host has the address a.b.c.d we will refer to it here using
  564.    d.c.b.a.IN-ADDR.ARPA. The domain field of the RRs in named.rev
  565.    (and named.local) is of the form d.c.b.a when the origin is 
  566.    IN-ADDR.ARPA for this file.
  567.  
  568.    named.rev contains the following types of records:
  569.    * a SOA record for b.a.IN-ADDR.ARPA
  570.    * a NS record that makes host.dep.secdom.topdom. the primary 
  571.      nameserver for this domain
  572.    * a PTR record for each host given in named.hosts
  573.  
  574.    The PTR record looks like
  575.  
  576.    domain IN PTR full-domainname-of-the-host
  577.  
  578.    with
  579.  
  580.    domain  Since we defined b.a.IN-ADDR.ARPA the origin for this file
  581.            (in /etc/named.boot) we give here the *last* two bytes of
  582.            the internet address in dotted notation in reverse order. I.e.
  583.            if a host has the internet address a.b.10.2 associated
  584.            with it in named.rev we give 2.10 in the domain field of the 
  585.            corresponding PTR record.
  586.    IN PTR  defines the record to be a "pointer" record of class IN.
  587.    full-domainname-of-the-host
  588.            here we give the full domainname of the host that has been
  589.            given the internet address corresponding to "domain".
  590.  
  591.    Well, that's somewhat tricky. Let's have an example:
  592.    In named.hosts we have a host with the following A record
  593.    host.dep.secdom.topdom. IN A a.b.c.d
  594.    Now let's create the PTR record for this host in named.rev. In the 
  595.    domain b.a.IN-ADDR.ARPA our host has the domainname d.c so the
  596.    PTR record is
  597.    d.c  IN PTR host.dep.secdom.topdom.
  598.  
  599.  
  600.    Now that we have created named.rev only named.local is to be
  601.    created. named.local defines a special local domain 0.0.127.IN-ADDR.ARPA.
  602.    that is associated with the special hostname "localhost". This hostname
  603.    is given the ip address 127.0.0.1. Our named.local may look like
  604.    the following
  605.  
  606.  
  607. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  608. ;   named.local for secdom.topdom
  609. ;   last change 93/01/27            
  610. ;   93/05/27 -- sendmail changes
  611. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  612. ;  @(#)named.local 1.1 (fh-nuernberg) 93/01/25
  613. ;
  614. $ORIGIN 0.0.127.IN-ADDR.ARPA.
  615. @     IN   SOA    host.dep.secdom.topdom.  dnsadm.host.dep.secdom.topdom. (
  616.                           930817001 ; Serial
  617.                           28800     ; Refresh
  618.                           7200      ; Retry
  619.                           6044800   ; Expire
  620.                           172800 )  ; Minimum
  621.       IN   NS     host.dep.secdom.topdom.
  622. 1     IN   PTR    localhost.
  623.  
  624.  
  625.    Note: The network 127.0.0 is not a valid network to contain hosts. 
  626.          It is only used for testing. Packets addressed to 127.0.0.1
  627.          should *never* leave the local host.
  628.  
  629.     Setting up a primary nameserver for an internet host
  630.     ====================================================
  631.  
  632. ! When our host gets connected to the Internet (after serveral organizational 
  633. ! work done) we have to change our configuration slightly. There are two
  634. ! places we have to make changes at:
  635.  
  636. 1. We have to alter /etc/named.boot to let our host find the real
  637.    internet root nameservers. We have no longer to fake a root nameserver.
  638.    The line 
  639.    primary  .  root.cache
  640.    should be replaced by
  641.    cache   . root.cache
  642.  
  643. 2. We have to take the official root.cache file now. This file 
  644.    may have the following contents:
  645.  
  646.  
  647.  
  648. ;
  649. ;       This file holds the information on root name servers needed to
  650. ;       initialize cache of Internet domain name servers 
  651. ;       (e.g. reference this file in the "cache  .  <file>"
  652. ;       configuration file of BIND domain name servers).
  653. ;
  654. ;       This file is made available by InterNIC registration services
  655. ;       under anonymous FTP as
  656. ;           file                /domain/named.root
  657. ;           on server           FTP.RS.INTERNIC.NET
  658. ;       -OR- under Gopher at RS.INTERNIC.NET
  659. ;           under menu          InterNIC Registration Services (NSI)
  660. ;              submenu          InterNIC Registration Archives
  661. ;           file                named.root
  662. ;
  663. ;       last update:    April 21, 1993
  664. ;       related version of root zone:   930421
  665. ;
  666. .                        99999999 IN  NS    NS.INTERNIC.NET.
  667. NS.INTERNIC.NET.         99999999     A     198.41.0.4
  668. .                        99999999     NS    KAVA.NISC.SRI.COM.
  669. KAVA.NISC.SRI.COM.       99999999     A     192.33.33.24
  670. .                        99999999     NS    C.NYSER.NET.
  671. C.NYSER.NET.             99999999     A     192.33.4.12
  672. .                        99999999     NS    TERP.UMD.EDU.
  673. TERP.UMD.EDU.            99999999     A     128.8.10.90
  674. .                        99999999     NS    NS.NASA.GOV.
  675. NS.NASA.GOV.             99999999     A     128.102.16.10
  676.                          99999999     A     192.52.195.10
  677. .                        99999999     NS    NS.NIC.DDN.MIL.
  678. NS.NIC.DDN.MIL.          99999999     A     192.112.36.4
  679. .                        99999999     NS    AOS.ARL.ARMY.MIL.
  680. AOS.ARL.ARMY.MIL.        99999999     A     128.63.4.82
  681.                          99999999     A     192.5.25.82
  682. .                        99999999     NS    NIC.NORDU.NET.
  683. NIC.NORDU.NET.           99999999     A     192.36.148.17
  684. ; End of File
  685.  
  686. ! Here I replaced the copy of the root.cache file!
  687.  
  688.  
  689. ! There is some administrative work we have to do (if we haven't done
  690. ! it yet). We have to inform the administrators of our parent domain 
  691. ! about the nameserver(s) we have installed. We have to tell them
  692. ! 1. the full domain names of our primary and at least one secondary
  693. !    nameserver for our zone
  694. ! 2. the internet addresses of these servers.
  695. !
  696. ! We have to name at least to servers for our zone that are physically
  697. ! (i.e electricity) independent. The reason for this is that one of
  698. ! the nameservers for a zone should be available at least. 
  699. ! So we have to get someone external to run a secondary server for 
  700. ! our zone.
  701.  
  702. Well that's all.
  703.  
  704.  
  705. Setting up a secondary nameserver
  706. =================================
  707.  
  708. ! Well, for a secondary nameserver we have to make three files.
  709. ! The type of nameserver (primary/secondary) is determined on a zone
  710. ! basis. The same machine can be a primary for one zone and a 
  711. ! secondary for another zone. Which type of nameserver we run for
  712. ! which zone we have to give in the file /etc/named.boot. 
  713.  
  714. ! Here we assume a server which is secondary for our zone and 
  715. ! primary only for the zone 0.0.127.IN-ADDR.ARPA which is for
  716. ! the host running the server only.
  717.  
  718.  
  719. 1. /etc/named.boot may look like the following:
  720.  
  721.  
  722. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  723. ;   Nameserver bootfile for secdom.topdom       
  724. ;   last change 93/05/27
  725. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  726. ;
  727. ;  @(#)named.boot.master 1.11 of 93/01/25             
  728. ;
  729. ; bootfile for secondary master server fh-nuernberg
  730. ;
  731. directory /usr/name.dir 
  732. ;
  733. ; type        domain           source host/file      backup file
  734. ;
  735. ;cache         .                root.cache
  736. secondary     secdom.topdom      a.b.c.d           named.bak 
  737. secondary     b.a.IN-ADDR.ARPA  a.b.c.d            rev.bak
  738. primary       0.0.127.IN-ADDR.ARPA  named.local
  739. ;
  740. ;
  741.  
  742. ! In the above file I deleted the line with the domain statement.
  743.  
  744.  
  745. 2. named.local will be exactly analogous to the one described when 
  746.    "Setting up a primary master nameserver for a non-internet host (5.)"
  747.  
  748. 3. root.cache is the same as described when "Setting up a primary nameserver
  749.    for an internet host (3.)"
  750.  
  751. Note: Here I assume we have a internet connection.
  752.  
  753. If we don't have a connection to the internet and we have previously
  754. configured an internal root nameserver as described at the beginning
  755. of this document we may use the following root.cache file for our
  756. secondary that points to our "fake" root server:
  757.  
  758.  
  759. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  760. ; temporary root.cache file for a 
  761. ;secondary without internet connection
  762. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  763. ;
  764. . 99999999 IN NS host.dep.secdom.topdom
  765. host.dep.secdom.topdom. IN A a.b.c.d
  766.  
  767.  
  768. 4. Get named started with the appropriate startup file.
  769.